{layout name="public::layout" /}

<h4 class="text-success text-center">分类管理</h4>

<table class="table table-striped table-hover text-center">
	<tr>
		<td>ID</td>
		<td>栏目名称</td>
		<td>排序</td>
		<td>状态</td>
		<td>创建时间</td>
		<td colspan="2">操作</td>
	</tr>
	{volist name="cateList" id="cate" empty="$empty"}
	<tr>
		<td>{$cate.id}</td>
		<td>{$cate.name}</td>
		<td>{$cate.sort}</td>

		<td>
		{eq name="$cate.status" value="1"}
		<span style="color:forestgreen">显示</span>
		{else/}
		<span style="color:gray">隐藏</span>
		{/eq}
		</td>

		<td>{$cate.create_time}</td>
		
		<td><a href="{:url('cate/cateEdit',['id'=>$cate.id])}">编辑</a></td>
		<td><a href="" onclick="dele();return false;">删除</a></td>
	</tr>
	{/volist}
</table>
<!-- 分类需要添加操作 -->
<a class="btn btn-info" href="{:url('cate/cateAdd')}" role="button">添加分类</a>

<script>
	function dele()
	{
		if(confirm('您真的要删除吗?') == true){
			window.location.href = "{:url('cate/doDelete',['id'=>$cate.id])}"			
		}
	}
</script>





